package com;

import com.kalvan.core.annotations.EnableKalvan;
import com.kalvan.swagger.dubbo.annotations.EnableDubboSwagger;
import org.apache.dubbo.config.spring.context.annotation.DubboComponentScan;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.builder.SpringApplicationBuilder;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.boot.web.servlet.ServletComponentScan;
import org.springframework.boot.web.servlet.support.SpringBootServletInitializer;
import springfox.documentation.swagger2.annotations.EnableSwagger2;

/**
 * 多数据源需要 SpringBootApplication(exclude = { DataSourceAutoConfiguration.class
 * })<br>
 * 开启在线接口文档,如果方法参加对象里包括List 递归则会异常，暂时用 @ApiIgnore 解决 <br>
 * MapperScan mybatis扫描<br>
 * ServletComponentScan 支持打包成war包部署<br>
 *
 * @author chenliang
 */
@EnableConfigurationProperties
@SpringBootApplication
@EnableKalvan
@EnableDubboSwagger
@EnableSwagger2
@DubboComponentScan("com.kalvan")
@ServletComponentScan({"com.kalvan"})
public class AdminApplication extends SpringBootServletInitializer {
    public static void main(String[] args) {
        SpringApplication.run(AdminApplication.class, args);
    }

    @Override
    protected SpringApplicationBuilder configure(SpringApplicationBuilder application) {
        return application.sources(AdminApplication.class);
    }

}
